package com.example.demo.topic;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("topic")
public class TopicController {

    @Autowired
    private TopicSender topicSender;

    @ApiOperation("向topicMessage0发送消息")
    @PostMapping("sendTopicMessage0")
    public  String sendTopicMessage0(String messsage){
        topicSender.sendMessage0(messsage);
        return  messsage;
    }

    @ApiOperation("向topicMessage1发送消息")
    @PostMapping("sendTopicMessage1")
    public  String sendTopicMessage1(String messsage){
        topicSender.sendMessage1(messsage);
        return  messsage;
    }
}
